package org.lightdi.container.security;

import java.io.Serializable;
import java.util.Random;

public class ContainerLockKey implements Serializable {

	private static final long serialVersionUID = -8501636825546370581L;

	public ContainerLockKey() {
	}

	private String passKey;

	public Boolean isGenerated = false;

	public String generatePassKey() {
		synchronized (isGenerated) {
			if (isGenerated) {
				return null;
			} else {
				this.passKey = String.valueOf(new Random().nextInt());
				return this.passKey;
			}

		}
	}

	public String getPassKey() {
		return passKey;
	}
}
